def num_to_chinese_upper(num):
    #1.定义基础映射
    dight_map=['零','壹','贰','叁','肆','伍','陆','柒','捌','玖']
    unit_map=['','拾','佰','仟','万']
    num_str=(num)
    if not num_str.isdigit() or len(num_str)<1 or len(num_str)>5 or int(num)==0:
        return "输入错误：请输入1-5为正整数"
    num_str=num_str.zfill(5)
    result=""
    has_zero=False
    for i in range(5):
        digit=int(num_str[i])
        pos=4-i
        if digit==0:
            has_zero=True
        else:
            if has_zero:
                result+=dight_map[0]
            result+=dight_map[digit]+unit_map[pos]
            has_zero=False
    if len(result)>=2 and result[0]=='拾':
        result='壹'+result
    return result
user_input=input("请输入1-5位正整数：")
print("大写金额：",num_to_chinese_upper(user_input))